<template>
	<div class="main app-container">
		<div class="header">
			{{ projectVo.projectName }}
			<!-- <el-button
				v-if="
					projectVo.projectStage != 4 &&
					(userStore.$state.roles.includes('yw1') || userStore.$state.roles.includes('gc1') || userStore.$state.roles.includes('gc1'))
				"
				style="float: right"
				type="danger"
				@click="addJa"
				><el-icon style="margin-right: 3px"><View /></el-icon>项目结案</el-button
			> -->
			<span style="float: right">
				<el-button type="primary" style="margin-right: 5px" @click="toCheckLogs">查看项目审核日志</el-button>
				<el-button
					type="primary"
					style="margin-right: 5px"
					v-if="['yw2', 'yw1', 'jl', 'admin'].some((e) => userStore.$state.roles.includes(e))"
					@click="toCustom"
					><el-icon style="margin-right: 3px"><CirclePlusFilled /></el-icon>查看企业信息</el-button
				>
				<el-button
					v-if="!['cg2', 'sj2', 'gc2', 'cw2'].some((e) => userStore.$state.roles.includes(e)) && projectVo.projectStage == 1"
					type="primary"
					style="float: right"
					@click="toEdit()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>修改</el-button
				>
				<el-button
					v-if="['sj1', 'sj2', 'admin'].some((e) => userStore.$state.roles.includes(e))"
					type="primary"
					style="float: right"
					@click="toOpenFen()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>项目质量评价</el-button
				>
				<el-button
					v-if="['gc2'].some((e) => userStore.$state.roles.includes(e)) && projectVo.projectStage == 2 && [2, 9].includes(projectVo.projectStatus)"
					type="primary"
					@click="toFinish()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>工程验收</el-button
				>
				<el-button
					v-if="
						(userStore.$state.roles.includes('yw1') && [1, 10].includes(projectVo.projectStatus)) ||
						(userStore.$state.roles.includes('gc1') && [8].includes(projectVo.projectStatus)) ||
						(userStore.$state.roles.includes('jl') && [4, 5].includes(projectVo.projectStatus))
					"
					type="primary"
					@click="toCheck()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>审核</el-button
				>
				<el-button v-if="userStore.$state.roles.includes('yw1') && ![13].includes(projectVo.projectStatus)" type="primary" @click="toTaoTai()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>淘汰</el-button
				>
				<el-button v-if="userStore.$state.roles.includes('gc1') && [2].includes(projectVo.projectStatus)" type="primary" @click="toWeiBao()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>项目验收</el-button
				>
				<el-button type="primary" style="margin-right: 5px" @click="lookInfo()"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>附属信息</el-button
				>
				<el-button
					v-if="['admin', 'jl', 'yw1'].some((e) => userStore.$state.roles.includes(e)) && projectVo.projectstatus == 3 && projectVo.projectStage == 5"
					type="primary"
					@click="toDelete()"
					><el-icon style="margin-right: 5px"><Delete /></el-icon>删除</el-button
				>
				<!-- <el-button
					v-if="
						['admin', 'yw1'].some((e) => userStore.$state.roles.includes(e)) &&
						![4, 5].includes(projectVo.projectStatus) &&
						![4, 5].includes(projectVo.projectStage)
					"
					type="primary"
					@click="check(5)"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>淘汰审核</el-button
				> -->
				<el-button
					v-if="
						['admin', 'yw1'].some((e) => userStore.$state.roles.includes(e)) &&
						[11, 6].includes(projectVo.projectStatus) &&
						projectVo.projectStage == 3
					"
					type="primary"
					@click="check(4)"
					><el-icon style="margin-right: 5px"><Edit /></el-icon>完成审核</el-button
				>
			</span>
		</div>
		<el-divider style="margin: 15px 0" />
		<div class="content">
			<div class="content-header">
				<el-icon style="margin-right: 2px; position: relative; top: 2px"><DocumentCopy /></el-icon> 项目信息
				<el-button
					v-if="
						(projectVo.projectStage == 1 || projectVo.projectStage == 2) &&
						projectVo.projectStatus == 2 &&
						userStore.$state.roles.some((e) => e.includes('1'))
					"
					type="primary"
					style="float: right; margin-top: -5px"
					size="small"
					@click="addCy"
					>添加成员</el-button
				>
			</div>
			<div class="info">
				<div class="item">
					<span class="label">项目阶段</span>
					<dict-tag :options="project_stage" :value="projectVo.projectStage" />
				</div>
				<div class="item">
					<span class="label">项目状态</span>
					<dict-tag :options="project_status" :value="projectVo.projectStatus" />
				</div>
				<div class="item">
					<span class="label">项目类型</span>
					<dict-tag :options="project_category" :value="projectVo.projectCategory" />
				</div>
				<div class="item">
					<span class="label">联系人</span>
					{{ projectVo.projectContacts }}
				</div>
				<div class="item">
					<span class="label">联系电话</span>
					{{ projectVo.projectMobile }}
				</div>

				<div class="item">
					<span class="label">修改时间</span>
					{{ projectVo.updateTime }}
				</div>
			</div>
			<div class="info">
				<div class="item">
					<span class="label">客户名称</span>
					{{ customerVo.customerName }}
				</div>
				<div class="item">
					<span class="label">项目地址</span>
					{{ projectVo.projectAdress }}
				</div>
			</div>
			<!-- <div class="info">
				<div class="item">
					<span class="label">项目描述</span>
					{{ projectVo.projectAdress }}
				</div>
			</div> -->
		</div>
		<el-divider style="margin: 15px 0" />
		<div class="content">
			<div class="info">
				<div class="item">
					<span class="label">☆负责人</span>
					<el-tag type="danger" effect="dark">{{ projectStaffVoMap['yw2'] ? projectStaffVoMap['yw2'][0].userName : '' }}</el-tag>
				</div>
				<div class="item">
					<span class="label">设计</span>
					<div>
						<el-tag v-for="(item, index) in projectStaffVoMap['sj1']" :key="item.sysUserId" type="danger" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && userStore.$state.roles.includes('yw1')"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['sj1'])"
								><Close /></el-icon
						></el-tag>
						<el-tag v-for="(item, index) in projectStaffVoMap['sj2']" :key="item.sysUserId" type="" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && (userStore.$state.roles.includes('yw1') || userStore.$state.roles.includes('sj1'))"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['sj2'])"
								><Close /></el-icon
						></el-tag>
					</div>
				</div>
				<div class="item">
					<span class="label">工程</span>
					<div>
						<el-tag v-for="(item, index) in projectStaffVoMap['gc1']" :key="item.sysUserId" type="danger" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && userStore.$state.roles.includes('yw1')"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['gc1'])"
								><Close /></el-icon
						></el-tag>
						<el-tag v-for="(item, index) in projectStaffVoMap['gc2']" :key="item.sysUserId" type="" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && (userStore.$state.roles.includes('yw1') || userStore.$state.roles.includes('gc1'))"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['gc2'])"
								><Close /></el-icon
						></el-tag>
					</div>
				</div>
				<div class="item">
					<span class="label">采购</span>
					<div>
						<el-tag v-for="(item, index) in projectStaffVoMap['cg1']" :key="item.sysUserId" type="danger" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && userStore.$state.roles.includes('yw1')"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['cg1'])"
								><Close /></el-icon
						></el-tag>
						<el-tag v-for="(item, index) in projectStaffVoMap['cg2']" :key="item.sysUserId" type="" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && (userStore.$state.roles.includes('yw1') || userStore.$state.roles.includes('yw1'))"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['cg2'])"
								><Close /></el-icon
						></el-tag>
					</div>
				</div>
				<div class="item">
					<span class="label">财务</span>
					<div>
						<el-tag v-for="(item, index) in projectStaffVoMap['cw1']" :key="item.sysUserId" type="danger" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && userStore.$state.roles.includes('yw1')"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['cw1'])"
								><Close /></el-icon
						></el-tag>
						<el-tag v-for="(item, index) in projectStaffVoMap['cw2']" :key="item.sysUserId" type="" effect="dark"
							>{{ item.userName }}&nbsp;&nbsp;<el-icon
								size="14px"
								v-if="[1, 2].includes(projectVo.projectStage) && (userStore.$state.roles.includes('yw1') || userStore.$state.roles.includes('cw1'))"
								class="jue-se"
								@click="deleteChen(item, index, projectStaffVoMap['cw2'])"
								><Close /></el-icon
						></el-tag>
					</div>
				</div>
			</div>
		</div>
		<el-card shadow="hover" class="box-card">
			<div>
				<span class="box-header">公司基本信息</span>
				<el-button
					type="primary"
					style="float: right; margin-top: -5px"
					size="small"
					link
					@click="
						() => {
							isShow = !isShow
						}
					"
					><span style="font-weight: 600">{{ isShow ? '隐藏' : '展开' }}</span></el-button
				>
			</div>
			<el-divider v-if="isShow" style="margin: 10px 0" />
			<div class="cai-wu" style="flex-wrap: wrap; align-content: flex-start" v-if="isShow">
				<div class="cai-item" style="flex: 0 0 20%; display: flex">
					<span class="label">名称</span>
					<span>{{ customerVo.customerName }}</span>
				</div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex">
					<span class="label">地址</span>
					{{ customerVo.customerAdress }}
				</div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex; align-items: center">
					<span class="label">电话</span>
					<span>{{ customerVo.customerMobile }}</span>
				</div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex">
					<span class="label">网站</span>
					{{ customerVo.customerWebSite }}
				</div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex"></div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex">
					<span class="label">户名</span>
					<span>{{ customerVo.financeAccountName }}</span>
				</div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex">
					<span class="label">开户行</span>
					<span>{{ customerVo.financeAccountBlank }}</span>
				</div>
				<div class="cai-item" style="flex: 0 0 20%; display: flex; align-items: center">
					<span class="label">账号</span>
					<span>{{ customerVo.financeAccountNumber }}</span>
				</div>
				<div class="cai-item" style="flex: 0 0 40%; display: flex; align-items: center">
					<span class="label">统一编码</span>
					<span style="font-weight: 500">{{ customerVo.financeUnifiedCode }}</span>
				</div>
			</div>
		</el-card>
		<el-card shadow="hover" class="box-card">
			<template #header>
				<div>
					<span class="box-header">工程进度信息</span>
					<el-button @click="exportPross" type="primary" style="float: right; margin-top: -5px; margin-left: 5px; margin-right: 5px" size="small"
						>导出</el-button
					>
					<el-button
						v-if="
							([1, 2].includes(projectVo.projectStage) && userStore.$state.roles.includes('yw2')) ||
							(projectVo.projectStage == 2 && userStore.$state.roles.includes('gc1'))
						"
						type="primary"
						style="float: right; margin-top: -5px"
						size="small"
						@click="addGc"
						>修改工程信息</el-button
					>
				</div>
			</template>
			<div class="cai-wu" style="overflow-x: auto; padding-bottom: 5px">
				<div class="cai-card">
					<div class="card-left">
						<el-icon size="30px" style="position: relative; top: 10px"><Clock /></el-icon>
					</div>
					<div class="card-right">
						已开工<span style="color: #f66c6c; font-size: 24px; margin: 0 5px">{{ projectVo.workTime }}</span
						>天
					</div>
				</div>
				<div class="cai-card">
					<div class="card-left">
						<el-icon size="30px" style="position: relative; top: 10px"><Clock /></el-icon>
					</div>
					<div class="card-right">
						合同工期<span style="color: #337ab7; font-size: 24px; margin: 0 5px">{{ projectVo.treatyDays }}</span
						>天
					</div>
				</div>
				<div class="cai-card">
					<div class="card-left">
						<el-icon size="30px" color="#F66C6C" style="position: relative; top: 10px"><Bell /></el-icon>
					</div>
					<div class="card-right">
						安全<span style="color: #f66c6c; font-size: 24px; margin: 0 5px">{{ projectVo.progressSecureNumber }}</span
						>起
					</div>
				</div>
				<div class="top-b">
					<div class="top">合同签订日期</div>
					<div class="buttom">{{ projectVo.progressSignTime ? projectVo.progressSignTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">合同完工日期</div>
					<div class="buttom">{{ projectVo.progressFinishTime ? projectVo.progressFinishTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">实际开工日期</div>
					<div class="buttom">{{ projectVo.progressStartTime ? projectVo.progressStartTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">实际撤场日期</div>
					<div class="buttom">{{ projectVo.progressEndTime ? projectVo.progressEndTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">验收日期</div>
					<div class="buttom">{{ projectVo.progressCheckTime ? projectVo.progressCheckTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">审计日期</div>
					<div class="buttom">{{ projectVo.progressAuditTime ? projectVo.progressAuditTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">尾款到期日期</div>
					<div class="buttom">{{ projectVo.progressCashTime ? projectVo.progressCashTime : '---' }}</div>
				</div>
				<div class="top-b">
					<div class="top">保质到期日期</div>
					<div class="buttom">{{ projectVo.progressWarrantyTime ? projectVo.progressWarrantyTime : '---' }}</div>
				</div>
			</div>
		</el-card>
		<!-- <el-card shadow="hover" class="box-card">
			<template #header>
				<div>
					<span class="box-header">企业/项目联系人信息</span>
					<el-button
						v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('yw2')"
						type="primary"
						style="float: right; margin-top: -5px"
						size="small"
						@click="addPeople"
						>添加联系人</el-button
					>
				</div>
			</template>
			<div style="font-size: 14px">
				<div v-for="(item, index) in projectContactsVos" :key="item.contactsId" class="people-card">
					<div class="people-header">
						<el-icon size="16px" style="position: relative; top: 1px; cursor: pointer" @click="deletePeople(item, index)"><Close /></el-icon>
						<span style="font-size: 16px; font-weight: 600; float: right">{{ item.contactsName }}</span>
					</div>
					<div class="people-item">
						<span class="people-label">手机：</span><el-tag type="danger" effect="dark" style="height: 16px">{{ item.contactsMobile }}</el-tag>
					</div>
					<div class="people-item"><span class="people-label">职位：</span>{{ item.contactsJob }}</div>
					<div class="people-item"><span class="people-label">类型：</span>{{ item.categoryTypeName }}</div>
				</div>
			</div>
		</el-card>
		<el-card class="box-card">
			<template #header>
				<div>
					<span style="font-weight: 600">财务信息</span>
				</div>
			</template>
			<div class="cai-wu">
				<div style="flex: 1">
					<span class="label">合同金额</span>
					{{ projectFinancialVo.totalTreatyMoney }}
					元
				</div>
				<div style="flex: 1">
					<span class="label">审计金额</span>
					{{ projectFinancialVo.totalAuditMoney }}
					元
				</div>
				<div style="flex: 1">
					<span class="label">已开发票</span>
					{{ projectFinancialVo.invoicingMoney }}
					元
				</div>
				<div style="flex: 1">
					<span class="label">到账金额</span>
					{{ projectFinancialVo.received }}
					元
				</div>
			</div>
		</el-card> -->
		<el-divider style="margin: 15px 0" />
		<div class="content" style="margin-bottom: 20px">
			<div class="content-header">
				<svg-icon icon-class="system-erp" style="width: 18px; height: 18px; position: relative; top: 1px; margin-right: 10px" />合同信息
				<el-button style="float: right; margin-top: -5px" type="primary" @click="expotData">导出</el-button>
			</div>
			<el-divider style="margin: 15px 0" />
			<BaseTable :columns="columns" :dataList="dataList" noSelection>
				<template #action="{ row }">
					<!-- <el-button v-if="projectVo.projectStage != 4 && row.mailFlag == '2'" type="primary" size="small" plain @click="invoicing(row)"
						>发票申请</el-button
					> -->
				</template>
			</BaseTable>
			<div style="margin-top: 15px; color: rgb(64, 158, 255); font-size: 14px; display: flex; justify-content: flex-end">
				<span style="display: inline-block; text-align: right; padding-right: 30px">合同金额：{{ projectFinancialVo.totalTreatyMoney }}元</span>
				<span style="display: inline-block; text-align: right; padding-right: 30px">审计金额：{{ projectFinancialVo.totalAuditMoney }}元</span>
				<span style="display: inline-block; text-align: right; padding-right: 30px">应收款：{{ allRemainReceived }}元</span>
				<span style="display: inline-block; text-align: right; padding-right: 30px">已收款：{{ projectFinancialVo.received }}元</span>
				<span style="display: inline-block; text-align: right; padding-right: 30px">已开票：{{ projectFinancialVo.invoicingMoney }}元</span>
			</div>
		</div>
		<el-divider style="margin: 15px 0" />
		<div class="content" style="margin-bottom: 20px">
			<div class="content-header">
				<svg-icon icon-class="system-erp" style="width: 18px; height: 18px; position: relative; top: 1px; margin-right: 10px" />项目财务信息
			</div>
			<el-divider style="margin: 15px 0" />
			<div style="display: flex">
				<div style="width: 49.5%; margin-right: 1%">
					<div style="margin-bottom: 5px; font-weight: 600">
						开票记录
						<el-button
							v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('cw2')"
							type="primary"
							style="float: right; margin-top: -5px"
							size="small"
							@click="addKp"
							>新增</el-button
						>
						<el-button @click="exportPio" type="primary" style="float: right; margin-top: -5px; margin-left: 5px; margin-right: 5px" size="small"
							>导出</el-button
						>
					</div>
					<BaseTable :columns="columnsp" :dataList="dataListp" noSelection>
						<template #action="{ row }">
							<el-button
								v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('cw2')"
								type="primary"
								size="small"
								plain
								@click="delKp(row.invoicingId)"
								>删除记录</el-button
							>
							<el-button
								v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('cw2')"
								type="primary"
								size="small"
								plain
								@click="editKp(row)"
								>修改记录</el-button
							>
						</template>
					</BaseTable>
					<div style="height: 25px; line-height: 25px; color: #409eff; text-align: right; font-size: 14px">
						合计金额：{{ projectFinancialVo.invoicingMoney }}元
					</div>
				</div>
				<div style="width: 49.5%">
					<div style="margin-bottom: 5px; font-weight: 600">
						收款记录<el-button
							v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('cw2')"
							type="primary"
							style="float: right; margin-top: -5px"
							size="small"
							@click="addSk"
							>新增</el-button
						>
						<el-button @click="exportCollect" type="primary" style="float: right; margin-top: -5px; margin-left: 5px; margin-right: 5px" size="small"
							>导出</el-button
						>
					</div>
					<BaseTable :columns="columnsq" :dataList="dataListq" noSelection>
						<template #action="{ row }">
							<el-button
								v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('cw2')"
								type="primary"
								size="small"
								plain
								@click="delSk(row.collectionId)"
								>删除记录</el-button
							>
							<el-button
								v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('cw2')"
								type="primary"
								size="small"
								plain
								@click="editSk(row)"
								>修改记录</el-button
							>
						</template>
					</BaseTable>
					<div style="height: 25px; line-height: 25px; color: #409eff; text-align: right; font-size: 14px">
						合计金额：{{ projectFinancialVo.received }}元
					</div>
				</div>
			</div>
		</div>
		<el-divider style="margin: 15px 0" />
		<div class="content" style="margin-bottom: 20px">
			<div class="content-header">
				<svg-icon icon-class="system-erp" style="width: 18px; height: 18px; position: relative; top: 1px; margin-right: 10px" />项目阶段日志
				<span style="float: right"
					><el-button v-if="projectVo.projectStage != 4" type="danger" @click="addRecod"
						><el-icon style="margin-right: 2px"><CirclePlusFilled /></el-icon>添加日志</el-button
					>
					<el-button v-if="projectVo.projectStage != 4 && userStore.$state.roles.includes('yw2')" type="danger" @click="addPrice"
						>新增报价单</el-button
					>
					<el-button type="primary" @click="searchLog('')">全部信息</el-button>
					<el-button @click="searchLog('1')">商务日志</el-button>
					<el-button @click="searchLog('2')">设计日志</el-button>
					<el-button @click="searchLog('3')">工程日志</el-button>
					<el-button @click="searchLog('7')">维保日志</el-button>
					<el-button @click="searchLog('4')">财务日志</el-button>
					<el-button @click="searchLog('5')">招投标日志</el-button>
					<el-button @click="searchLog('6')">采购日志</el-button>
				</span>
			</div>
			<el-divider style="margin: 15px 0" />
			<BaseTable :columns="columnsr" :dataList="dataListr" noSelection>
				<template #logName="{ row }">
					<span style="cursor: pointer; color: #409eff" @click="toRecod(row)">{{ row.logName }}</span></template
				>
			</BaseTable>
		</div>
		<el-divider style="margin: 15px 0" />
		<!-- 项目资料 -->
		<div class="content" style="margin-bottom: 20px">
			<div class="content-header" style="height: 40px">
				<svg-icon icon-class="system-erp" style="width: 18px; height: 18px; position: relative; top: 12px; margin-right: 10px" />
				<span style="position: relative; top: 12px">项目资料</span>

				<span style="float: right; margin-top: -5px">
					<el-checkbox-group v-model="radio1" fill="" size="small" @change="changeChecked1">
						<el-checkbox-button key="1" label="1">施工资料</el-checkbox-button>
						<el-checkbox-button key="4" label="4">施工图纸</el-checkbox-button>
						<el-checkbox-button key="5" label="5">施工采购</el-checkbox-button>
						<el-checkbox-button key="3" label="3">设计方案</el-checkbox-button>
						<el-checkbox-button key="2" label="2">结案书</el-checkbox-button>
					</el-checkbox-group>
				</span>
				<span style="float: right; margin-top: -5px; margin-right: 10px">
					<el-button
						type="danger"
						size="small"
						v-if="userStore.$state.roles.includes('gc1') && projectVo.projectStage == 2"
						@click="openResorce('1', null, '0')"
						>施工资料</el-button
					>
					<el-button
						type="danger"
						v-if="userStore.$state.roles.includes('gc1') && projectVo.projectStage == 2"
						size="small"
						@click="openResorce('4', null, '0')"
						>施工图纸</el-button
					>
					<el-button
						type="danger"
						size="small"
						v-if="userStore.$state.roles.includes('gc1') && projectVo.projectStage == 2"
						@click="openResorce('5', null, '0')"
						>施工采购</el-button
					>
					<el-button
						type="danger"
						size="small"
						v-if="userStore.$state.roles.includes('sj2') && projectVo.projectStage == 1"
						@click="openResorce('3', null, '0')"
						>设计方案</el-button
					>
					<el-button
						type="danger"
						v-if="userStore.$state.roles.includes('gc1') && projectVo.projectStage == 2"
						size="small"
						@click="openResorce('2', null, '0')"
						>结案书</el-button
					>
				</span>
				<br />
				<span style="float: right; margin-top: 5px">
					<el-checkbox-group v-model="radio2" fill="" size="small" @change="changeChecked2">
						<el-checkbox-button v-for="item in resource_type" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox-button>
					</el-checkbox-group>
				</span>
				<span style="float: right; margin-top: 5px; margin-right: 10px">
					<el-checkbox-group fill="" v-model="radio3" size="small" @change="changeChecked3">
						<el-checkbox-button  key="1" label="1"><span class="changeColor">客户资料</span></el-checkbox-button>
						<el-checkbox-button  key="2" label="2"><span class="changeColor">分包资料</span></el-checkbox-button>
					</el-checkbox-group>
				</span>
			</div>
			<el-divider style="margin: 15px 0" />
			<BaseTable :columns="columnsRes" :dataList="dataListRes" noSelection>
				<template #resourceName="{ row }">
					<span style="cursor: pointer; color: #409eff" @click="openResorce(null, row, '2')">{{ row.resourceName }}</span>
				</template>
				<template #action="{ row, index }">
					<el-button type="primary" size="small" plain @click="checkLogs(row.resourceId)">审核记录</el-button>
					<el-button
						type="primary"
						v-if="row.createUserCode != userStore.$state.name && row.resourceStatus == '3'"
						size="small"
						plain
						@click="openResorce(null, row, '1')"
						>修改</el-button
					>
					<el-button
						type="primary"
						v-if="row.createUserCode != userStore.$state.name && row.resourceStatus == '3'"
						size="small"
						plain
						@click="deleteRes(row, index)"
						>删除</el-button
					>
					<el-button
						v-if="
							((userStore.$state.roles.includes('sj1') && row.resourceCategory == '3') ||
								(userStore.$state.roles.includes('gc1') && row.resourceCategory != '3')) &&
							row.resourceStatus == '1'
						"
						type="primary"
						size="small"
						plain
						@click="openResorce(null, row, '3')"
						>审核</el-button
					>
				</template>
			</BaseTable>
		</div>
		<el-divider v-if="['3', '6', '7', '9'].includes(projectVo.projectStatus + '')" style="margin: 15px 0" />
		<div v-if="['3', '6', '7', '9'].includes(projectVo.projectStatus + '')" class="content">
			<div class="content-header">
				<svg-icon icon-class="system-erp" style="width: 18px; height: 18px; position: relative; top: 1px; margin-right: 10px" />
				审核原因
			</div>
			<el-divider style="margin: 15px 0" />
			<el-input disabled v-model="projectVo.auditNote" :rows="5" type="textarea" placeholder="请输入项目描述" />
		</div>
		<el-divider v-if="['3', '6', '7', '9'].includes(projectVo.projectStatus + '')" style="margin: 15px 0" />
		<!-- 项目结案 -->
		<!-- <el-dialog :title="jiaTitle" v-model="openJa" width="800px" append-to-body :close-on-click-modal="false">
			<stageView @changeZhuang="changeZhuang" :data="projectEnd" :projectId="route.query.id" :type="item.value" :id="route.query.id" :token="token" />
			 <div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button @click="cancelJa">取 消</el-button>
				</div>
			</div>
		</el-dialog> -->
		<!-- 添加成员 -->
		<el-dialog :title="`添加成员`" v-model="openCy" width="800px" append-to-body :close-on-click-modal="false">
			<el-form ref="baseformCy" :model="formCy" label-position="right" :rules="rulesCy" label-width="120px">
				<el-form-item v-for="item in optionCy" :prop="item.key" :label="item.label">
					<el-select multiple v-model="formCy[item.key]" placeholder="请选择" style="width: 50%" size="default" value-key="sysUserId" clearable>
						<el-option v-for="dict in item.value" :key="dict.sysUserId" :label="dict.userName" :value="dict" />
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button type="primary" @click="submitCy">确 定</el-button>
					<el-button @click="cancelCy">取 消</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 添加联系人 -->
		<el-dialog :title="`添加联系人`" v-model="open" width="800px" append-to-body :close-on-click-modal="false">
			<el-form ref="baseform" :model="form" label-position="right" :rules="rules" label-width="120px">
				<el-form-item prop="contactsName" label="姓名">
					<el-input v-model="form.contactsName" style="width: 50%" placeholder="请输入姓名" />
				</el-form-item>
				<el-form-item prop="contactsJob" label="职位">
					<el-input v-model="form.contactsJob" style="width: 50%" placeholder="请输入职位" />
				</el-form-item>
				<el-form-item prop="contactsCategory" label="类型">
					<el-select v-model="form.contactsCategory" placeholder="请选择类型" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in contacts_category" :key="dict.value" :label="dict.label" :value="dict.value" />
					</el-select>
				</el-form-item>
				<el-form-item prop="contactsMobile" label="联系方式">
					<el-input v-model="form.contactsMobile" style="width: 50%" placeholder="请输入联系方式" />
				</el-form-item>
				<el-form-item prop="contactsNote" label="备注">
					<el-input v-model="form.contactsNote" style="width: 50%" placeholder="请输入备注" />
				</el-form-item>
				<el-form-item prop="contactsStatus" label="标注">
					<el-radio-group v-model="form.contactsStatus">
						<el-radio v-for="item in contacts_status" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
					</el-radio-group>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button type="primary" @click="submitAdd">确 定</el-button>
					<el-button @click="cancel">取 消</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 修改工程信息 -->
		<el-dialog :title="`修改工程信息`" v-model="openGc" width="800px" append-to-body :close-on-click-modal="false">
			<el-form ref="baseformGc" :model="formGc" label-position="right" :rules="rulesGc" label-width="120px">
				<!-- <el-form-item prop="treatyDays" label="合同工期">
					<el-input v-model="formGc.treatyDays" style="width: 50%" placeholder="请输入" />
				</el-form-item> -->
				<el-form-item prop="progressSecureNumber" label="事故次数">
					<el-input v-model="formGc.progressSecureNumber" style="width: 50%" placeholder="请输入" />
				</el-form-item>
				<el-form-item prop="progressSignTime" label="合同签订日期">
					<el-date-picker
						clearable
						v-model="formGc.progressSignTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressFinishTime" label="合同完工日期">
					<el-date-picker
						clearable
						v-model="formGc.progressFinishTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressStartTime" label="实际开工日期">
					<el-date-picker
						clearable
						v-model="formGc.progressStartTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressEndTime" label="实际撤场日期">
					<el-date-picker
						clearable
						v-model="formGc.progressEndTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressCheckTime" label="验收日期日期">
					<el-date-picker
						clearable
						v-model="formGc.progressCheckTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressAuditTime" label="审计日期">
					<el-date-picker
						clearable
						v-model="formGc.progressAuditTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressCashTime" label="尾款到期日期">
					<el-date-picker
						clearable
						v-model="formGc.progressCashTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="progressWarrantyTime" label="质保到期日期">
					<el-date-picker
						clearable
						v-model="formGc.progressWarrantyTime"
						style="width: 240px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择`"></el-date-picker>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button type="primary" @click="submitGc">确 定</el-button>
					<el-button @click="cancelGc">取 消</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 新增开票信息 -->
		<el-dialog :title="`新增/修改开票记录`" v-model="openKp" width="800px" append-to-body :close-on-click-modal="false">
			<el-form ref="baseformKp" :model="formKp" label-position="right" :rules="rulesKp" label-width="120px">
				<el-form-item prop="treatyId" label="选择合同">
					<el-select
						v-model="formKp.treatyId"
						style="width: 50%; margin-right: 10px"
						filterable
						remote
						reserve-keyword
						remote-show-suffix
						placeholder="请选择合同"
						:remote-method="remoteMethodT"
						:loading="loadingT">
						<el-option v-for="item in optionsT" :key="item.value" :label="item.label" :value="item.value" />
					</el-select>
				</el-form-item>
				<el-form-item prop="invoicingCode" label="发票号码">
					<el-input v-model="formKp.invoicingCode" style="width: 50%" placeholder="请输入发票号码" />
				</el-form-item>
				<el-form-item prop="invoicingTime" label="开票时间">
					<el-date-picker
						clearable
						v-model="formKp.invoicingTime"
						style="width: 320px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择开票时间`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="invoicingMoney" label="开票金额">
					<el-input v-model="formKp.invoicingMoney" style="width: 50%" placeholder="请输入开票金额" />
				</el-form-item>
				<el-form-item prop="invoicingStatus" label="状态">
					<el-select v-model="formKp.invoicingStatus" style="width: 50%; margin-right: 10px" placeholder="请选择">
						<el-option v-for="item in invoicing_status" :key="item.value" :label="item.label" :value="item.value" />
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button type="primary" @click="submitKp">确 定</el-button>
					<el-button @click="cancelKp">取 消</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 新增收款信息 -->
		<el-dialog :title="`新增/修改收款信息`" v-model="openSk" width="800px" append-to-body :close-on-click-modal="false">
			<el-form ref="baseformSk" :model="formSk" label-position="right" :rules="rulesSk" label-width="120px">
				<el-form-item prop="treatyId" label="选择合同">
					<el-select
						v-model="formSk.treatyId"
						style="width: 50%; margin-right: 10px"
						filterable
						remote
						reserve-keyword
						remote-show-suffix
						placeholder="请选择合同"
						:remote-method="remoteMethodT"
						:loading="loadingT">
						<el-option v-for="item in optionsT" :key="item.value" :label="item.label" :value="item.value" />
					</el-select>
				</el-form-item>
				<el-form-item prop="collectionAccountName" label="账号">
					<el-input v-model="formSk.collectionAccountName" style="width: 50%" placeholder="请输入账号" />
				</el-form-item>
				<el-form-item prop="collectionTime" label="收款日期">
					<el-date-picker
						clearable
						v-model="formSk.collectionTime"
						style="width: 320px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择收款日期`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="collectionMoney" label="收款金额">
					<el-input v-model="formSk.collectionMoney" style="width: 50%" placeholder="请输入收款金额" />
				</el-form-item>
				<el-form-item prop="collectionStatus" label="状态">
					<el-select v-model="formSk.collectionStatus" style="width: 50%; margin-right: 10px" placeholder="请选择">
						<el-option v-for="item in collection_status" :key="item.value" :label="item.label" :value="item.value" />
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button type="primary" @click="submitSk">确 定</el-button>
					<el-button @click="cancelSk">取 消</el-button>
				</div>
			</div>
		</el-dialog>
		<!-- 资料信息 -->
		<el-dialog :title="`资料信息-${formRes.title}`" v-model="openRes" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
			<stageView :data="formRes" @closeRes="closeRes" />
		</el-dialog>
		<el-dialog title="项目审核" v-model="openCheck" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
			<el-form ref="baseformCheck" :model="formCheck" label-position="right" :rules="rulesCheck" label-width="120px">
				<el-form-item prop="projectStatus" label="审核">
					<el-radio-group v-model="formCheck.projectStatus">
						<el-radio label="1">审核通过</el-radio>
						<el-radio label="2">审核不通过</el-radio>
					</el-radio-group>
				</el-form-item>
				<el-form-item prop="auditNote" label="审核备注">
					<el-input v-model="formCheck.auditNote" :rows="5" type="textarea" style="margin-bottom: 5px" placeholder="审核备注" />
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<div style="text-align: right">
					<el-button type="primary" @click="submit">确 定</el-button>
					<el-button
						@click="
							() => {
								openCheck = false
							}
						"
						>取 消</el-button
					>
				</div>
			</div>
		</el-dialog>
		<el-dialog :title="`附属信息`" v-model="openIn" width="1200px" append-to-body>
			<el-form ref="ss" :model="formInfo" label-position="right" :rules="rulesCy" label-width="240px">
				<el-form-item prop="projectType" label="项目类型">
					<el-select disabled v-model="formInfo.projectType" placeholder="请选择项目类型" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_type" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectBuildType" label="建筑类型">
					<el-select disabled v-model="formInfo.projectBuildType" placeholder="请选择建筑类型" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_build_type" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectFireLevel" label="项目防火等级">
					<el-select disabled v-model="formInfo.projectFireLevel" placeholder="请选择项目防火等级" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_fire_level" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectBuildStructure" label="建筑结构">
					<el-select disabled v-model="formInfo.projectBuildStructure" placeholder="请选择建筑结构" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_build_structure" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item label="项目面积"> 单层面积{{ formInfo.projectSingleArea }}m²， 总楼面积{{ formInfo.projectTotalArea }}m² </el-form-item>
				<el-form-item label="项目楼层"> 所在楼层{{ formInfo.projectCurrentFloor }}层， 总楼层{{ formInfo.projectTotalFloor }}层 </el-form-item>
				<el-form-item label="楼层高度">
					层高{{ formInfo.projectFloorHight }}m， 梁下高{{ formInfo.projectLiangHight }}m， 最低点高{{ formInfo.projectMinHight }}m， 吊灯高{{
						formInfo.projectDengHight
					}}m
				</el-form-item>
				<el-form-item prop="progressFinishTime" label="项目交付时间">
					<el-date-picker
						clearable
						disabled
						v-model="formInfo.progressFinishTime"
						style="width: 380px"
						value-format="YYYY-MM-DD"
						type="date"
						:placeholder="`请选择项目交付时间`"></el-date-picker>
				</el-form-item>
				<el-form-item prop="projectIndustry" label="项目行业">
					<el-select disabled v-model="formInfo.projectIndustry" placeholder="请选择项目行业" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_industry" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectContent" label="项目类容">
					<el-select disabled v-model="formInfo.projectContent" placeholder="请选择项目类容" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_content" :key="dict.value" :label="dict.label" :value="dict.value" />
					</el-select>
				</el-form-item>
				<el-form-item label="工作人员数量">
					<el-input-number
						disabled
						style="width: 340px"
						:controls="false"
						v-model="formInfo.projectStaffNum"
						:precision="0"
						:step="0"
						:min="0"
						placeholder="请输入" />
				</el-form-item>
				<el-form-item prop="projectIdent" label="认证需求">
					<el-checkbox-group disabled v-model="formInfo.projectIdent">
						<el-checkbox v-for="item in project_ident" :key="item.value" style="position: relative; top: -3px" :label="item.value" size="large">
							{{ item.label }}
						</el-checkbox>
					</el-checkbox-group>
				</el-form-item>
				<el-form-item prop="projectDesign" label="暖通专业设计需求">
					<el-checkbox-group disabled v-model="formInfo.projectDesign">
						<el-checkbox v-for="item in project_design" :key="item.value" style="position: relative; top: -3px" :label="item.value" size="large">
							{{ item.label }}
						</el-checkbox>
					</el-checkbox-group>
				</el-form-item>
				<el-form-item prop="projectFloorDescribe" label="楼层及屋面承重及空间位置">
					<el-input disabled v-model="formInfo.projectFloorDescribe" style="width: 50%" placeholder="请输入楼层及屋面承重及空间位置" />
				</el-form-item>
				<el-form-item prop="projectExhaustGas" label="废气类型">
					<el-checkbox-group disabled v-model="formInfo.projectExhaustGas">
						<el-checkbox v-for="item in project_exhaust_gas" :key="item.value" style="position: relative; top: -3px" :label="item.value" size="large">
							{{ item.label }}
						</el-checkbox>
					</el-checkbox-group>
				</el-form-item>
				<el-form-item prop="projectAirDescribe" label="风井位置及尺寸">
					<el-input disabled v-model="formInfo.projectAirDescribe" style="width: 50%" placeholder="请输入风井位置及尺寸" />
				</el-form-item>
				<el-form-item prop="projectIsPiping" label="外立面是否可以走风管">
					<el-select disabled v-model="formInfo.projectIsPiping" placeholder="请选择外立面是否可以走风管" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_is_piping" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectColdHot" label="是否有冷热源，及其形式">
					<el-input disabled v-model="formInfo.projectColdHot" style="width: 50%" placeholder="请输入是否有冷热源，及其形式" />
				</el-form-item>
				<el-form-item prop="projectStrongElectricity" label="现有强电总功率">
					<el-input disabled v-model="formInfo.projectStrongElectricity" style="width: 50%" placeholder="请输入现有强电总功率" />
				</el-form-item>
				<el-form-item prop="projectDrainage" label="排水方式">
					<el-select disabled v-model="formInfo.projectDrainage" placeholder="请选择排水方式" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_drainage" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectDrainageSize" label="排水管总尺寸">
					<el-input disabled v-model="formInfo.projectDrainageSize" style="width: 50%" placeholder="请输入排水管总尺寸" />
				</el-form-item>
				<el-form-item prop="projectPipingType" label="现有给排水管材">
					<el-checkbox-group disabled v-model="formInfo.projectPipingType">
						<el-checkbox v-for="item in project_piping_type" :key="item.value" style="position: relative; top: -3px" :label="item.value" size="large">
							{{ item.label }}
						</el-checkbox>
					</el-checkbox-group>
				</el-form-item>
				<el-form-item prop="projectGassType" label="供气形式">
					<el-select disabled v-model="formInfo.projectGassType" placeholder="请选择供气形式" style="width: 50%" size="default" clearable>
						<el-option v-for="dict in project_gass_type" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
					</el-select>
				</el-form-item>
				<el-form-item prop="projectSharpDescribe" label="是否有利旧项目，利旧范围">
					<el-input disabled v-model="formInfo.projectSharpDescribe" style="width: 50%" placeholder="请输入是否有利旧项目，利旧范围" />
				</el-form-item>
				<el-form-item prop="projectElevatorSize" label="主入口及电梯尺寸">
					<el-input disabled v-model="formInfo.projectElevatorSize" style="width: 50%" placeholder="请输入主入口及电梯尺寸" />
				</el-form-item>
				<el-form-item prop="projectFireFighting" label="是否含消防改造">
					<el-radio-group disabled v-model="formInfo.projectFireFighting">
						<el-radio v-for="item in project_fire_fighting" :key="item.value" :label="item.value">{{ item.label }}</el-radio>
					</el-radio-group>
				</el-form-item>
				<el-divider style="margin: 15px 0" />
				<div style="font-size: 16px; font-weight: 600; padding-left: 20px">大功率电器</div>
				<el-divider style="margin: 15px 0" />
				<div class="item-row" v-for="(item, index) in formInfo.projectDeviceBoList" :key="index">
					<div class="item-col">设备名称：{{ item.deviceName }}</div>
					<div class="item-col">设备功率：{{ item.devicePower }}</div>
					<div class="item-col">设备尺寸：{{ item.deviceSize }}</div>
				</div>
			</el-form>
		</el-dialog>
		<!-- 项目质量评价信息 -->
		<el-dialog :title="`项目质量评价`" v-model="openFen" width="800px" append-to-body :close-on-click-modal="false">
			<el-form ref="baseformKp" :model="addFenItem" label-position="right" label-width="120px">
				<el-form-item label="数据添加">
					<el-select v-model="addFenItem.staffId" style="width: 240px; margin-right: 20px" placeholder="请选择成员">
						<el-option v-for="dict in sj2Map" :key="dict.value" :label="dict.label" :value="dict.value" />
					</el-select>
					<el-input-number
						v-model="addFenItem.evaluateScore"
						:controls="false"
						:min="0"
						:max="100"
						:precision="0"
						style="width: 120px; margin-right: 20px"
						placeholder="请输入分数" />
					<el-button type="primary" v-if="userStore.$state.roles.includes('sj1')" @click="addFen">添加</el-button>
				</el-form-item>
			</el-form>
			<div
				v-for="(item, index) in fenList"
				style="display: flex; width: 100%; line-height: 35px; justify-content: space-around"
				:key="item.evaluateId">
				<div style="text-align: center">
					{{ getLabel(item.staffId, sj2Map) }}
				</div>
				<div style="text-align: center">
					<dict-tag :options="evaluate_status" :value="item.evaluateStatus" />
				</div>
				<div style="text-align: center">
					<el-input-number
						v-model="item.evaluateScore"
						:disabled="item.evaluateStatus == '2' || !userStore.$state.roles.includes('sj1')"
						:controls="false"
						:min="0"
						:max="100"
						:precision="0"
						style="width: 120px; margin-right: 20px"
						placeholder="请输入分数" />
				</div>
				<div style="text-align: center">
					<el-button type="primary" v-if="item.evaluateStatus == '1' && userStore.$state.roles.includes('sj1')" size="small" @click="toEditFen(item)"
						>修改</el-button
					>
					<el-button
						type="primary"
						v-if="item.evaluateStatus == '1' && userStore.$state.roles.includes('sj2')"
						size="small"
						@click="toEditStatus(item)"
						>确认</el-button
					>
					<el-button type="danger" v-if="userStore.$state.roles.includes('sj1')" size="small" @click="toDeleteFen(item)">删除</el-button>
				</div>
			</div>
		</el-dialog>
		<div style="line-height: 80px; height: 80px; padding-left: 100px">
			<el-button @click="reback">返回</el-button>
		</div>
	</div>
</template>
<script setup>
import { computed, reactive, ref, watch } from 'vue'
import BaseTable from '@/components/BaseTable'
import stageView from './stageView'
import {
	getDetail,
	addPerson,
	queryLog,
	deletePerson,
	updateProject,
	findStaff,
	insertStaff,
	selectProjectEnd,
	addTreatyInvoicing,
	selectTreatyInvoicing,
	updateTreatyInvoicing,
	delTreatyInvoicing,
	selectTreatyCollection,
	addTreatyCollection,
	updateTreatyCollection,
	delTreatyCollection,
	selectTreaty,
	selectMoneyCensus,
	delStaff,
	sendPiao,
	delProject,
	mailSend,
	deleteResource,
	selectRes,
	qualitys,
	qualityAdd,
	qualityEdit,
	qualityDelete
} from '@/api/project/project'
import { useRoute } from 'vue-router'
import { getConfigKey } from '@/api/system/config'
// import { exportPross, exportCollect, exportPio, exportProcure } from '@/api/export/index'
import { getToken } from '@/utils/auth'
import useUserStore from '@/store/modules/user'
import useTagsViewStore from '@/store/modules/tagsView'
import { getLabel } from '@/utils/getLabel'

import moment from 'moment'
const tagsView = useTagsViewStore()
const userStore = useUserStore()
const fileUrl = ref('')
getConfigKey('file_upload').then((response) => {
	fileUrl.value = response.msg
})
const token = { Authorization: 'Bearer ' + getToken() }
const route = useRoute()
const router = useRouter()
const { proxy } = getCurrentInstance()

const {
	project_stage,
	project_category,
	project_status,
	collection_status,
	invoicing_status,
	log_type,
	contacts_category,
	contacts_status,
	file_category,
	project_type,
	project_build_type,
	project_fire_level,
	project_build_structure,
	project_industry,
	project_content,
	project_ident,
	project_design,
	project_exhaust_gas,
	project_is_piping,
	project_drainage,
	project_piping_type,
	project_gass_type,
	project_fire_fighting,
	resource_category,
	resource_type,
	evaluate_status
} = proxy.useDict(
	'project_stage',
	'project_category',
	'project_status',
	'collection_status',
	'invoicing_status',
	'log_type',
	'contacts_category',
	'contacts_status',
	'file_category',
	'project_type',
	'project_build_type',
	'project_fire_level',
	'project_build_structure',
	'project_industry',
	'project_content',
	'project_ident',
	'project_design',
	'project_exhaust_gas',
	'project_is_piping',
	'project_drainage',
	'project_piping_type',
	'project_gass_type',
	'project_fire_fighting',
	'resource_category',
	'resource_type',
	'evaluate_status'
)
const kpOption = ref([])
const optionsT = ref([])

selectTreaty({ projectId: route.query.id }).then((res) => {
	kpOption.value = res.map((e) => {
		return {
			label: e.treatyName,
			value: e.treatyId + ''
		}
	})
	optionsT.value = kpOption.value
})
const toFinish = () => {
	updateProject({ projectId: route.query.id, projectStatus: '8' }).then((res) => {
		proxy.$modal.msgSuccess('操作成功！')
		projectVo.value.projectStatus = 8
	})
}
const loadingT = ref(false)
const remoteMethodT = (query) => {
	if (query) {
		loadingT.value = true
		setTimeout(() => {
			loadingT.value = false
			optionsT.value = kpOption.value.filter((item) => {
				return item.label.toLowerCase().includes(query.toLowerCase())
			})
		}, 200)
	} else {
		optionsT.value = kpOption.value
	}
}
const projectVo = ref({})
const projectContactsVos = ref([])
const customerVo = ref({})
const projectFinancialVo = ref({})
const allRemainReceived = ref('')
const projectStaffVoMap = ref({})
const endName = ref('1')
if (userStore.$state.roles.includes('yw1')) {
	endName.value = '4'
}
const optionTis = ref([])
watch(file_category, () => {
	optionTis.value = file_category.value.filter((e) => {
		if (userStore.$state.roles.includes('yw1')) {
			return e.value == '4'
		} else {
			return e.value != '4'
		}
	})
})

const dataList = ref([])
const dataListr = ref([])
const searchLog = (type) => {
	queryLog({ logType: type, projectId: route.query.id }).then((res) => {
		dataListr.value = res.data
	})
}
searchLog()
//开票记录
const dataListp = ref([])
//收款记录
const dataListq = ref([])
const selectMoney = () => {
	selectMoneyCensus({ projectId: route.query.id }).then((res) => {
		projectFinancialVo.value = res.data
	})
}
const sj2Map = ref([])
if (route.query.id) {
	getDetail(route.query.id).then((res) => {
		allRemainReceived.value = res.data.allRemainReceived
		projectVo.value = res.data.projectVo
		projectContactsVos.value = res.data.projectContactsVos
		customerVo.value = res.data.customerVo
		projectStaffVoMap.value = res.data.projectStaffVoMap
		dataList.value = res.data.projectTreatyVos
		for (let item in formInfo) {
			formInfo[item] = res.data.projectVo[item]
		}
		formInfo.projectFireFighting = formInfo.projectFireFighting + ''
		formInfo.projectIdent = res.data.projectVo.projectIdent?.split(',')
		formInfo.projectDesign = res.data.projectVo.projectIdent?.split(',')
		formInfo.projectExhaustGas = res.data.projectVo.projectIdent?.split(',')
		formInfo.projectPipingType = res.data.projectVo.projectIdent?.split(',')
		formInfo.projectDeviceBoList = res.data.projectVo.projectDeviceBoList
		if (projectStaffVoMap.value['sj2']) {
			sj2Map.value = projectStaffVoMap.value['sj2'].map((e) => {
				return {
					label: e.nickName,
					value: e.sysUserId
				}
			})
		}
	})
	selectMoney()
}
const toEdit = () => {
	router.push({
		path: '/project/projectEdit',
		query: { id: projectVo.value.projectId }
	})
}
const openFen = ref(false)

const fenList = ref([])
const addFenItem = reactive({
	staffId: undefined,
	evaluateScore: 0,
	projectId: route.query.id
})
const getQu = () => {
	qualitys({
		projectId: projectVo.value.projectId
	}).then((res) => {
		fenList.value = res
	})
}
const toOpenFen = () => {
	openFen.value = true
	getQu()
}
const addFen = () => {
	qualityAdd(addFenItem).then((res) => {
		proxy.$modal.msgSuccess('添加成功！')
		getQu()
	})
}
const toEditFen = (row) => {
	qualityEdit(row).then((res) => {
		proxy.$modal.msgSuccess('修改成功！')
	})
}
const toEditStatus = (row) => {
	row.evaluateStatus = 2
	qualityEdit(row).then((res) => {
		proxy.$modal.msgSuccess('确认成功！')
	})
}
const toDeleteFen = (row) => {
	proxy.$modal
		.confirm('是否确认此操作？')
		.then(() => {
			return qualityDelete(row.evaluateId)
		})
		.then(() => {
			getQu()
			proxy.$modal.msgSuccess('删除成功!')
		})
		.catch(() => {})
}
const openIn = ref(false)
const lookInfo = () => {
	openIn.value = true
}
const formInfo = reactive({
	projectId: undefined,
	customerId: undefined,
	projectName: undefined,
	isImportant: '2',
	projectAdress: undefined,
	projectContacts: undefined,
	projectMobile: undefined,
	projectStage: '1',
	projectCategory: undefined,
	projectDescribe: undefined,
	projectType: undefined,
	projectBuildType: undefined,
	projectFireLevel: undefined,
	projectBuildStructure: undefined,
	projectSingleArea: undefined,
	projectTotalArea: undefined,
	projectCurrentFloor: undefined,
	projectTotalFloor: undefined,
	projectFloorHight: undefined,
	projectLiangHight: undefined,
	projectMinHight: undefined,
	projectDengHight: undefined,
	projectIndustry: undefined,
	projectContent: undefined,
	projectStaffNum: undefined,
	projectIdent: [],
	projectDesign: [],
	projectFloorDescribe: undefined,
	projectExhaustGas: [],
	projectAirDescribe: undefined,
	projectIsPiping: undefined,
	projectColdHot: undefined,
	projectStrongElectricity: undefined,
	projectDrainage: undefined,
	projectDrainageSize: undefined,
	projectPipingType: [],
	projectGassType: undefined,
	projectSharpDescribe: undefined,
	projectElevatorSize: undefined,
	projectFireFighting: undefined,
	progressFinishTime: undefined,
	projectDeviceBoList: []
})
const toDelete = () => {
	proxy.$modal
		.confirm('是否确认此操作？')
		.then(() => {
			return delProject(projectVo.value.projectId)
		})
		.then(() => {
			tagsView.delView(router.currentRoute.value)
			router.go(-1)
			proxy.$modal.msgSuccess('删除成功!')
		})
		.catch(() => {})
}
const check = (status) => {
	proxy.$modal
		.confirm('是否确认此操作？')
		.then(() => {
			return updateProject({ projectId: projectVo.value.projectId, projectStatus: status })
		})
		.then(() => {
			tagsView.delView(router.currentRoute.value)
			router.go(-1)
			proxy.$modal.msgSuccess('审核成功!')
		})
		.catch(() => {})
}
const objp = { projectId: projectVo.value.projectId }
const exportCollect = () => {
	proxy.download(
		'/function/project/projectTreatyCollectionExport',
		{ projectId: projectVo.value.projectId },
		`${projectVo.value.projectName}_收款信息_${moment(Date.now()).format('YYYY年MM月DD日HH点mm分ss秒')}.xlsx`
	)
}
const exportPio = () => {
	proxy.download(
		'/function/project/projectTreatyInvoicingExport',
		{ projectId: projectVo.value.projectId },
		`${projectVo.value.projectName}_开票信息_${moment(Date.now()).format('YYYY年MM月DD日HH点mm分ss秒')}.xlsx`
	)
}
const exportPross = () => {
	proxy.download(
		'/function/project/projectProgressExport',
		{ projectId: projectVo.value.projectId },
		`${projectVo.value.projectName}_工程进度_${moment(Date.now()).format('YYYY年MM月DD日HH点mm分ss秒')}.xlsx`
	)
}
// const changeZhuang = () => {
// 	selectProjectEnd({ projectId: route.query.id }).then((res) => {
// 		projectEnd.value = res.data
// 		if (res.data.status) {
// 			projectVo.value.projectStage = '3'
// 		} else {
// 			projectVo.value.projectStage = '2'
// 		}
// 	})
// }
// 合同
const columns = ref([
	{ key: 0, label: `编号`, width: '150', prop: 'treatyCode', type: 'text', visible: true },
	{ key: 1, label: `名称`, prop: 'treatyName', type: 'text', visible: true },
	{ key: 3, width: '180', label: `日期`, prop: 'treatyTime', type: 'date', visible: true },
	{ key: 4, width: '120', label: `合同金额`, prop: 'treatyTotalMoney', type: 'text', visible: true },
	{ key: 5, width: '120', label: `审计金额`, prop: 'treatyAuditMoney', type: 'text', visible: true },
	{ key: 6, width: '120', label: `应收款`, prop: 'treatyRemainMoney', type: 'text', visible: true },
	{ key: 7, width: '120', label: `已收款`, prop: 'collectionMoney', type: 'text', visible: true },
	{ key: 8, width: '120', label: `已开票`, prop: 'invoicingMoney', type: 'text', visible: true }
	//{ key: 9, width: '120', label: `操作`, prop: 'action', type: 'custom', visible: true }
])
// 资料
const formRes = ref({})
const openRes = ref(false)
const closeRes = () => {
	getListRes()
	openRes.value = false
}
const openResorce = (type, row, way) => {
	if (row) {
		formRes.value = row
		switch (row.resourceCategory) {
			case 1:
				formRes.value.title = '施工资料'
				break
			case 2:
				formRes.value.title = '结案书'
				break
			case 3:
				formRes.value.title = '设计方案'
				break
			case 4:
				formRes.value.title = '施工图纸'
				break
			case 5:
				formRes.value.title = '施工采购'
				break
		}
	} else {
		formRes.value = {
			resourceId: undefined,
			projectId: route.query.id,
			resourceName: undefined,
			resourceCategory: type,
			resourceType: undefined,
			resourceStatus: undefined,
			projectResource: undefined,
			type: undefined
		}
		switch (type) {
			case '1':
				formRes.value.title = '施工资料'
				break
			case '2':
				formRes.value.title = '结案书'
				break
			case '3':
				formRes.value.title = '设计方案'
				break
			case '4':
				formRes.value.title = '施工图纸'
				break
			case '5':
				formRes.value.title = '施工采购'
				break
		}
	}
	formRes.value.type = way
	openRes.value = true
}
const columnsRes = ref([
	{ key: 0, label: `标题`, prop: 'resourceName', type: 'custom', visible: true },
	{ key: 3, label: `类别`, width: '150', prop: 'resourceType', type: 'select', data: resource_type, visible: true },
	{ key: 3, label: `分类`, width: '150', prop: 'resourceCategory', type: 'select', data: resource_category, visible: true },
	{ key: 1, label: `状态`, width: '150', prop: 'resourceStatus', type: 'select', data: project_status, visible: true },
	{ key: 2, width: '210', label: `操作`, prop: 'action', type: 'custom', visible: true }
])
const dataListRes = ref([])
const getListRes = () => {
	selectRes({ projectId: route.query.id }).then((res) => {
		dataListRes.value = res
	})
}
const radio1 = ref([])
const changeChecked1 = () => {
	if (radio1.value.length > 1) {
		radio1.value.shift()
	}
	selectRes({ projectId: route.query.id, resourceCategory: radio1.value[0], resourceType: radio2.value[0], resourceRange: radio3.value[0] }).then(
		(res) => {
			dataListRes.value = res
		}
	)
}
const radio2 = ref([])
const changeChecked2 = () => {
	if (radio2.value.length > 1) {
		radio2.value.shift()
	}
	selectRes({ projectId: route.query.id, resourceCategory: radio1.value[0], resourceType: radio2.value[0], resourceRange: radio3.value[0] }).then(
		(res) => {
			dataListRes.value = res
		}
	)
}
const radio3 = ref([])
const changeChecked3 = () => {
	if (radio3.value.length > 1) {
		radio3.value.shift()
	}
	selectRes({ projectId: route.query.id, resourceCategory: radio1.value[0], resourceType: radio2.value[0], resourceRange: radio3.value[0] }).then(
		(res) => {
			dataListRes.value = res
		}
	)
}

getListRes()
const deleteRes = (row, index) => {
	proxy.$modal
		.confirm('是否确认删除？')
		.then(() => {
			return deleteResource(row.resourceId)
		})
		.then(() => {
			dataListRes.value.splice(index, 1)
			proxy.$modal.msgSuccess('删除成功')
		})
		.catch(() => {})
}
//开票记录
const columnsp = ref([
	{ key: 0, label: `合同编号`, width: '150', prop: 'treatyCode', type: 'text', visible: true },
	{ key: 1, label: `发票号码`, width: '150', prop: 'invoicingCode', type: 'text', visible: true },
	{ key: 2, width: '180', label: `时间`, prop: 'invoicingTime', type: 'date', visible: true },
	{ key: 4, width: '120', label: `开票金额`, prop: 'invoicingMoney', type: 'text', visible: true },
	{ key: 9, width: '90', label: `状态`, prop: 'invoicingStatus', type: 'select', data: invoicing_status, visible: true },
	{ key: 10, width: '200', label: `操作`, prop: 'action', type: 'custom', visible: true }
])

//收款记录
const columnsq = ref([
	{ key: 0, label: `合同编号`, width: '150', prop: 'treatyCode', type: 'text', visible: true },
	{ key: 1, label: `账户`, prop: 'collectionAccountName', type: 'text', visible: true },
	{ key: 2, width: '180', label: `时间`, prop: 'collectionTime', type: 'date', visible: true },
	{ key: 4, width: '120', label: `收款金额`, prop: 'collectionMoney', type: 'text', visible: true },
	{ key: 9, width: '90', label: `状态`, prop: 'collectionStatus', type: 'select', data: collection_status, visible: true },
	{ key: 10, width: '200', label: `操作`, prop: 'action', type: 'custom', visible: true }
])

//项目阶段日志
const columnsr = ref([
	{ key: 0, label: `日志类型`, width: '100', prop: 'logType', type: 'select', data: log_type, visible: true },
	{ key: 1, label: `日志标题`, prop: 'logName', type: 'custom', visible: true },
	{ key: 2, width: '150', label: `日志时间`, prop: 'logTime', type: 'date', visible: true },
	{ key: 3, width: '150', label: `更新时间`, prop: 'updateTime', type: 'dateTime', visible: true },
	{ key: 4, width: '90', label: `发布`, prop: 'nickName', type: 'text', visible: true }
])

const open = ref(false)
const form = reactive({
	projectId: route.query.id,
	contactsName: '',
	contactsJob: '',
	contactsCategory: '',
	contactsMobile: '',
	contactsNote: '',
	contactsStatus: ''
})
const rules = {
	contactsName: [{ required: true, message: '联系人姓名不能为空', trigger: 'blur' }],
	contactsJob: [{ required: true, message: '联系人职位不能为空', trigger: 'blur' }],
	contactsCategory: [{ required: true, message: '联系人类型不能为空', trigger: 'blur' }],
	contactsMobile: [{ required: true, message: '联系方式不能为空', trigger: 'blur' }]
}
const deleteChen = (row, index, data) => {
	proxy.$modal
		.confirm('是否确认删除账号为"' + row.userName + '"的成员？')
		.then(() => {
			return delStaff(row.staffId)
		})
		.then(() => {
			data.splice(index, 1)
			proxy.$modal.msgSuccess('删除成功!')
		})
		.catch(() => {})
}
const baseform = ref()
const addPeople = () => {
	for (let item in form) {
		form[item] = ''
	}
	;(form.projectId = route.query.id), (open.value = true)
}
const isShow = ref(false)
const files = reactive({ 1: [], 2: [], 3: [], 4: [] })

const submitAdd = () => {
	baseform.value.validate((valid, e) => {
		if (valid) {
			addPerson(form).then((res) => {
				proxy.$modal.msgSuccess('添加成功！')
				projectContactsVos.value.push(res.data)
				open.value = false
			})
		}
	})
}
const projectEnd = ref({})
selectProjectEnd({ projectId: route.query.id }).then((res) => {
	projectEnd.value = res.data
	for (let item of res.data.fileAdressList) {
		files[item.fileCategory].push(item)
	}
})
const cancel = () => {
	for (let item in form) {
		form[item] = ''
	}
	open.value = false
}
const openCy = ref(false)
const optionCy = ref([])

const getRoles = () => {
	findStaff({ projectId: route.query.id }).then((res) => {
		optionCy.value = res.filter((e) => {
			if (projectVo.value.projectStage == 1) {
				return true
			}
			if (projectVo.value.projectStage == 2) {
				return true
			}
			return false
		})
	})
}
getRoles()
const formCy = reactive({
	design: [],
	procure: [],
	finance: [],
	engineer: []
})
const rulesCy = {}
const baseformCy = ref()
const addCy = () => {
	for (let item in formCy) {
		formCy[item] = []
	}
	getRoles()
	openCy.value = true
}
const submitCy = () => {
	baseformCy.value.validate((valid, e) => {
		if (valid) {
			insertStaff({ ...formCy, projectId: route.query.id }).then((res) => {
				openCy.value = false
				proxy.$modal.msgSuccess('修改成功！')
				getDetail(route.query.id).then((res) => {
					projectVo.value = res.data.projectVo
					projectStaffVoMap.value = res.data.projectStaffVoMap
				})
				getRoles()
			})
		}
	})
}
const cancelCy = () => {
	for (let item in formCy) {
		formCy[item] = []
	}
	openCy.value = false
}
const openGc = ref(false)
const formGc = reactive({
	projectId: route.query.id,
	treatyDays: '',
	workTime: '',
	progressSecureNumber: '',
	progressSignTime: '',
	progressFinishTime: '',
	progressStartTime: '',
	progressEndTime: '',
	progressCheckTime: '',
	progressAuditTime: '',
	progressCashTime: '',
	progressWarrantyTime: ''
})
const rulesGc = {}
const baseformGc = ref()
const addGc = () => {
	for (let item in formGc) {
		formGc[item] = projectVo.value[item]
	}
	openGc.value = true
}
const submitGc = () => {
	baseformGc.value.validate((valid, e) => {
		if (valid) {
			updateProject(formGc).then((res) => {
				for (let item in formGc) {
					projectVo.value[item] = res.data[item]
				}
				openGc.value = false
				proxy.$modal.msgSuccess('修改成功！')
			})
		}
	})
}
const jiaTitle = ref('')
const cancelGc = () => {
	for (let item in formGc) {
		formGc[item] = ''
	}
	openGc.value = false
}
const openJa = ref(false)

const addJa = (title) => {
	jiaTitle.value = title
	openJa.value = true
}

const cancelJa = () => {
	openJa.value = false
}
//开票记录管理
const openKp = ref(false)
const formKp = reactive({
	invoicingId: '',
	treatyId: '',
	invoicingCode: '',
	invoicingTime: '',
	invoicingMoney: '',
	invoicingStatus: ''
})
const rulesKp = {
	treatyId: [{ required: true, message: '合同不能为空', trigger: 'blur' }],
	invoicingCode: [{ required: true, message: '发票号码不能为空', trigger: 'blur' }],
	invoicingTime: [{ required: true, message: '开票时间不能为空', trigger: 'blur' }],
	invoicingMoney: [{ required: true, message: '开票金额不能为空', trigger: 'blur' }],
	invoicingStatus: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
}
const baseformKp = ref()
const addKp = () => {
	openKp.value = true
	for (let item in formKp) {
		formKp[item] = ''
	}
}
const editKp = (row) => {
	openKp.value = true
	for (let item in formKp) {
		formKp[item] = row[item] + ''
	}
}
const delKp = (id, index) => {
	proxy.$modal
		.confirm('是否确认id为"' + id + '"的开票记录？')
		.then(() => {
			return delTreatyInvoicing(id)
		})
		.then(() => {
			proxy.$modal.msgSuccess('删除成功')
			selectInvoicing()
			selectMoney()
			getDetail(route.query.id).then((res) => {
				dataList.value = res.data.projectTreatyVos
			})
		})
		.catch(() => {})
}
const selectInvoicing = () => {
	selectTreatyInvoicing({ projectId: route.query.id }).then((res) => {
		dataListp.value = res
	})
}
selectInvoicing()
const submitKp = () => {
	baseformKp.value.validate((valid, e) => {
		if (valid) {
			if (formKp.invoicingId && formKp.invoicingId != '') {
				updateTreatyInvoicing(formKp).then((res) => {
					openKp.value = false
					proxy.$modal.msgSuccess('修改成功！')
					selectInvoicing()
					selectMoney()
					getDetail(route.query.id).then((res) => {
						dataList.value = res.data.projectTreatyVos
					})
				})
			} else {
				addTreatyInvoicing(formKp).then((res) => {
					openKp.value = false
					proxy.$modal.msgSuccess('新增成功！')
					selectInvoicing()
					selectMoney()
					getDetail(route.query.id).then((res) => {
						dataList.value = res.data.projectTreatyVos
					})
				})
			}
		}
	})
}
const cancelKp = () => {
	for (let item in formKp) {
		formKp[item] = ''
	}
	openKp.value = false
}
//收款记录管理
const openSk = ref(false)
const formSk = reactive({
	collectionId: '',
	treatyId: '',
	collectionAccountName: '',
	collectionTime: '',
	collectionMoney: '',
	collectionStatus: ''
})
const rulesSk = {
	treatyId: [{ required: true, message: '合同不能为空', trigger: 'blur' }],
	collectionAccountName: [{ required: true, message: '账号不能为空', trigger: 'blur' }],
	collectionTime: [{ required: true, message: '收款时间不能为空', trigger: 'blur' }],
	collectionMoney: [{ required: true, message: '收款金额不能为空', trigger: 'blur' }],
	collectionStatus: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
}
const selectCollection = () => {
	selectTreatyCollection({ projectId: route.query.id }).then((res) => {
		dataListq.value = res
	})
}
const baseformSk = ref()
const addSk = () => {
	openSk.value = true
	for (let item in formSk) {
		formSk[item] = ''
	}
}
const editSk = (row) => {
	openSk.value = true
	for (let item in formSk) {
		formSk[item] = row[item] + ''
	}
}
const delSk = (id, index) => {
	proxy.$modal
		.confirm('是否确认id为"' + id + '"的开票记录？')
		.then(() => {
			return delTreatyCollection(id)
		})
		.then(() => {
			proxy.$modal.msgSuccess('删除成功')
			selectCollection()
			selectMoney()
			getDetail(route.query.id).then((res) => {
				dataList.value = res.data.projectTreatyVos
			})
		})
		.catch(() => {})
}

selectCollection()
const submitSk = () => {
	baseformSk.value.validate((valid, e) => {
		if (valid) {
			if (formSk.collectionId && formSk.collectionId != '') {
				updateTreatyCollection(formSk).then((res) => {
					openSk.value = false
					proxy.$modal.msgSuccess('修改成功！')
					selectCollection()
					selectMoney()
					getDetail(route.query.id).then((res) => {
						dataList.value = res.data.projectTreatyVos
					})
				})
			} else {
				addTreatyCollection(formSk).then((res) => {
					openSk.value = false
					proxy.$modal.msgSuccess('新增成功！')
					selectCollection()
					selectMoney()
					getDetail(route.query.id).then((res) => {
						dataList.value = res.data.projectTreatyVos
					})
				})
			}
		}
	})
}
const expotData = () => {
	proxy.download(
		'/function/treaty/export',
		{ projectId: route.query.id },
		`${projectVo.value.projectName}_合同_${moment(Date.now()).format('YYYY年MM月DD日HH点mm分ss秒')}.xlsx`
	)
}
const openCheck = ref(false)
const toCheck = () => {
	openCheck.value = true
}
const toTaoTai = () => {
	updateProject({
		projectId: route.query.id,
		auditNote: '',
		projectStatus: 12
	}).then((res) => {
		proxy.$modal.msgSuccess('淘汰成功！')
		projectVo.value.projectStatus = 12
	})
}
const toWeiBao = () => {
	if (dataListRes.value.length <= 0) {
		proxy.$modal
			.alertWarning('请先上传资料，再进行验收操作')
			.then(() => {})
			.catch(() => {})
		return
	}
	proxy.$modal.confirm('信息是否完善，并进行验收操作？').then(() => {
		return updateProject({
			projectId: route.query.id,
			auditNote: '',
			projectStatus: 10
		})
			.then((res) => {
				proxy.$modal.msgSuccess('提交成功！')
				projectVo.value.projectStatus = 10
			})
			.catch(() => {})
	})
}
const formCheck = reactive({
	projectId: route.query.id,
	auditNote: '',
	projectStatus: ''
})
const rulesCheck = {
	projectStatus: [{ required: true, message: '审核状态不能为空', trigger: 'blur' }]
}
const baseformCheck = ref()
const submit = () => {
	baseformCheck.value.validate((valid, e) => {
		if (valid) {
			if (formCheck.projectStatus == '2') {
				if (projectVo.value.projectStatus == '1') {
					formCheck.projectStatus = '3'
				} else if (projectVo.value.projectStatus == '5') {
					formCheck.projectStatus = '7'
				} else if (projectVo.value.projectStatus == '4') {
					formCheck.projectStatus = '6'
				} else if (projectVo.value.projectStatus == '8') {
					formCheck.projectStatus = '9'
				}
			} else {
				if (projectVo.value.projectStatus == '1') {
					formCheck.projectStatus = '2'
				} else if (projectVo.value.projectStatus == '5') {
					formCheck.projectStage = '5'
					formCheck.projectStatus = '12'
				} else if (projectVo.value.projectStatus == '4') {
					formCheck.projectStage = '4'
					formCheck.projectStatus = '13'
				} else if (projectVo.value.projectStatus == '8') {
					formCheck.projectStatus = '10'
				} else if (projectVo.value.projectStatus == '10') {
					formCheck.projectStage = '3'
					formCheck.projectStatus = '11'
				}
			}
			updateProject(formCheck).then((res) => {
				proxy.$modal.msgSuccess('审核成功！')
				openCheck.value = false
				projectVo.value.projectStatus = Number(formCheck.projectStatus)
				if (formCheck.projectStage && formCheck.projectStage != '') {
					projectVo.value.projectStage = Number(formCheck.projectStage)
				}
			})
		}
	})
}
const cancelSk = () => {
	for (let item in formSk) {
		formSk[item] = ''
	}
	openSk.value = false
}

const toRecod = (row) => {
	router.push({
		path: '/project/viewLog',
		query: { id: row.logId }
	})
}

const addRecod = () => {
	router.push({
		path: '/project/addLog',
		query: {
			id: route.query.id,
			projectName: projectVo.value.projectName,
			customerName: customerVo.value.customerName,
			stage: projectVo.value.projectStage
		}
	})
}
const addPrice = () => {
	router.push({
		path: '/price/priceManage?id=' + ''
	})
}
const toCustom = () => {
	router.push({
		path: '/customer/customDetail',
		query: { id: customerVo.value.customerId }
	})
}
const checkLogs = (id) => {
	router.push({
		path: '/log/logManage',
		query: { id: id, type: 2 }
	})
}
const toCheckLogs = () => {
	router.push({
		path: '/log/logManage',
		query: { id: route.query.id, type: 1 }
	})
}
const invoicing = (row) => {
	if (projectStaffVoMap.value['cw2'] && projectStaffVoMap.value['cw2'].length > 0) {
		sendPiao({ projectId: row.projectId, treatyId: row.treatyId }).then((res) => {
			row.mailFlag = 1
			proxy.$modal.msgSuccess('提示成功!')
		})
	} else {
		proxy.$modal.msgWarning('请先配置财务员!')
	}
}
const reback = () => {
	tagsView.delView(router.currentRoute.value)
	router.go(-1)
}
</script>

<style lang="scss" scoped>
:deep(.el-tag) {
	margin-right: 5px;
}
:deep(.el-checkbox-button__inner:hover) {
	color: #606266 !important;
	//border: #606266 !important;
}
:deep(.el-checkbox-button) {
	//--el-checkbox-button-checked-text-color: #606266;
	--el-checkbox-button-checked-border-color: #dcdfe6;
	font-weight: 400 !important;
}
:deep(.el-checkbox-button__inner:has(> .changeColor)){
	background-color: #E6A23C;
}
:deep(.is-checked .el-checkbox-button__inner:has(> .changeColor)){
	background-color: #409EFF !important;
}

.item-row {
	height: 50px;
	line-height: 50px;
	border-bottom: 1px rgba(240, 240, 240, 1) solid;
	display: flex;
	padding-left: 50px;
	.item-col {
		flex: 3;
		text-align: left;
	}
}
.main {
	background-color: #ffffff;
	.header {
		font-size: 24px;
		color: black;
		font-weight: 600;
	}
	.content {
		.content-header {
			color: black;
			font-weight: 600;
			margin-bottom: 10px;
		}
		.info {
			display: flex;
			line-height: 40px;
			.item {
				flex: 1;
				font-size: 14px;
				display: flex;
				line-height: 28px;
				font-size: 14px;
				margin-bottom: 5px;
				.jue-se {
					position: absolute;
					margin-left: -5px;
					margin-top: -1px;
					cursor: pointer;
				}
				.label {
					color: #325e8e;
					background-color: #f2f2f1;
					margin-right: 5px;
					height: 24px;
					min-width: 40px;
					padding: 0 5px;
				}
			}
		}
	}
	.box-card {
		background-color: #f9f9f9;
		margin-top: 10px;
		.box-header {
			font-weight: 800;
			font-size: 14px;
		}
		.people-card {
			width: 250px;
			height: 120px;
			border: #dcdfe6 1px solid;
			background-color: #f4f4f6;
			display: inline-block;
			margin-right: 15px;
			.people-header {
				border-bottom: #dcdfe6 1px solid;
				height: 30px;
				line-height: 30px;
				padding: 0 10px;
			}
			.people-item {
				padding: 0 10px;
				height: 30px;
				line-height: 30px;
				.people-label {
					font-weight: 600;
				}
			}
		}
		.cai-wu {
			font-size: 14px;
			display: flex;
			justify-content: space-between;
			.label {
				font-weight: 600;
			}
			.cai-item {
				display: inline-block;
				line-height: 40px;
				.label {
					font-weight: 600;
					min-width: 40px;
					margin-right: 5px;
				}
			}
			.cai-card {
				display: flex;
				width: 180px;
				height: 60px;
				border: 1px #dcdfe6 solid;
				padding: 5px;
				margin-right: 10px;
				background-color: #ffffff;
				.card-left {
					width: 50px;
					border-right: #dcdfe6 1px solid;
					text-align: center;
				}
				.card-right {
					width: 130px;
					text-align: center;
					line-height: 50px;
					font-size: 12px;
				}
			}
			.top-b {
				width: 100px;
				min-width: 100px;
				height: 60px;
				border: #dcdfe6 1px solid;
				padding: 5px;
				margin-right: 10px;
				background-color: #ffffff;
				.top {
					font-weight: 600;
					text-align: center;
					height: 25px;
					line-height: 25px;
					border-bottom: 1px #dcdfe6 solid;
				}
				.buttom {
					text-align: center;
					height: 25px;
					line-height: 25px;
				}
			}
		}
	}
}
</style>
